<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <meta charset="utf-8"/>
        <title>Solution billeterie</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta name="description" content=""/>
        <meta name="author" content=""/>
        <!-- Le styles -->
        <link href="assets/css/bootstrap.css" rel="stylesheet"/>
        <link href="assets/css/main.css" rel="stylesheet"/>
        <style type="text/css">
            body {
                padding-top: 60px;
            }
        </style>
        <link href="assets/css/bootstrap-responsive.css" rel="stylesheet" />
        <link rel="shortcut icon" href="assets/ico/favicon.ico"/>
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png" />
        <!-- Google Fonts call. Font Used Open Sans -->
        
    </h:head>
    <h:body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="index.xhtml?faces-redirect=true"><img src="assets/img/logo-small.png" alt=""/> Solution Billetterie</a>
                    <ui:include src="header.xhtml" />
                </div>
            </div>
        </div>
        <!-- *********************************************************************************** -->
        <div class="container">
            <!-- CONTENT -->
            <div class="row-fluid">
                <br/>
                <!-- Invoice -->
                <div style="height: 550px;" class="invoice-unit">
                    <div class="invoice">
                        <div class="invoice-name">
                            Vente
                        </div>
                        <div class="invoice-company">
                            <h3 style="font-size:26px;"><strong>Vente</strong></h3>
                        </div>                          
                    </div>
                    <h:form>
                        <center>
                            <p:tabView style="height: 450px;" id="tabView">  

                                <p:tab id="tab1" title="vente"> 

                                    <h:panelGrid columns="3">
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5"  
                                                     >  
                                            <h:outputText value="Spectacle" />  
                                            <p:selectOneListbox style="height:300px;width:300px"   >  

                                                <f:selectItems value="#{venteBean.evenements}" var="event" itemLabel="#{event.id}-#{event.titre}" itemValue="#{event.id}" />
                                            </p:selectOneListbox>  
                                        </h:panelGrid>
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">  


                                            <h:outputText value="Type carte" />  
                                            <p:selectOneListbox value="#{venteBean.id_type_carte}"  style="height:300px;width:300px" >  
                                                <f:selectItems   value="#{venteBean.types}" var="type" itemLabel="#{type.id}-#{type.typeCarte}-#{type.modele}" itemValue="#{type.id}" />
                                                <p:ajax update="prix,place"   
                                                        listener="#{venteBean.prixIt()}" />
                                            </p:selectOneListbox>  

                                        </h:panelGrid>
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">
                                            <h:outputText value="Prix:" />
                                            <h:inputText id="prix" readonly="true" style="font-size: medium" value="#{venteBean.prix} DT" />
                                            <h:outputText value="Places libres:" />
                                            <h:inputText id="place" readonly="true" value="#{venteBean.places}" />
                                            <h:outputText value="Code billet:" />
                                            <h:inputText  value="" />                               

                                            <h:commandButton type="button" style="float: left;"  class="btn btn-primary" value="Enregistrer" />
                                            <h:button  style="float: left;" class="btn btn-danger" value="Annuler     " />

                                        </h:panelGrid>
                                    </h:panelGrid>
                                </p:tab>
                                <p:tab  title="Kit billets"> 
                                    <h:panelGrid columns="3">
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">  
                                            <h:outputText value="Spectacle" />  
                                            <p:selectManyMenu value="#{venteBean.ids_event}" style="height:300px;width:300px" id="basic" >  
                                                <f:selectItems value="#{venteBean.evenements}" var="event" itemLabel="#{event.id}-#{event.titre}" itemValue="#{event.id}" />
                                            <p:ajax update="prix1,place1,remise"   
                                                    listener="#{venteBean.remiseIt()}" />
                                            </p:selectManyMenu> 
                                        </h:panelGrid>
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">  
                                            <h:outputText value="Type carte" />  
                                            <p:selectOneListbox value="#{venteBean.id_type_carte}"  style="height:300px;width:300px" >  
                                                <f:selectItems   value="#{venteBean.types}" var="type" itemLabel="#{type.id}-#{type.typeCarte}-#{type.modele}" itemValue="#{type.id}" />
                                                <p:ajax update="prix1,place1"   
                                                        listener="#{venteBean.prixIt1()}" />
                                            </p:selectOneListbox>  
                                        </h:panelGrid>
                                        <h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">
                                            <h:outputText value="Prix Total:" />
                                            <h:inputText id="prix1" readonly="true" style="font-size: medium" value="#{venteBean.prixTotal} DT" />
                                            <h:outputText value="Nombre Sprectacles:" />
                                            <h:inputText id="place1" readonly="true" value="#{venteBean.ids_event.size()}" />
                                             <h:outputText value="Remise:" />
                                             <h:inputText id="remise" readonly="true" value="#{venteBean.remise}%" />
                                          
                                            <h:outputText value="Code billet:" />
                                            <h:inputText  value="" />                               
                                            <h:panelGrid columns="2">
                                            <h:commandButton type="button" style="float: left;"  class="btn btn-primary" value="Enregistrer" />
                                            <h:button  style="float: left;" class="btn btn-danger" value="Annuler     " />
                                            </h:panelGrid>
                                        </h:panelGrid>
                                    </h:panelGrid>
                                </p:tab>
                            </p:tabView>
                        </center>
                    </h:form>
                </div><!-- /BlockUnit -->
            </div><!-- /row -->
        </div>
        



    </h:body>
</html>